import React from 'react'
import { Table, Modal, Radio, Tag, message } from 'antd';
import { Action, AuthButton, TableCard } from 'components';
const TableList = ({ dataSource, setDataSource }) => {
    


 

    return (
        <div>

            
            <TableCard
                rowKey="locker_number"
                dataSource={dataSource}

            >
                <Table.Column title="区号" dataIndex="physical_zone" />
                <Table.Column title="区域" dataIndex="locker_user_type" />
                <Table.Column title="柜号" dataIndex="locker_number" />

                <Table.Column title="柜类型" dataIndex="locker_product_class" />
                <Table.Column title="柜品种" dataIndex="locker_type"  />
                   <Table.Column title="规格" dataIndex="locker_spec_name"  />
                <Table.Column width={180} title="操作" render={info => (
                    <Action>

                        <Action.Button  >编辑</Action.Button>
                        <Action.Button danger

                            onClick={() => {
                                const cabinetToDelete = info.locker_number;

                                setDataSource(prevData => {
                                    return prevData.filter(item => item.locker_number !== cabinetToDelete);
                             
                        
                                });
                            }}
                        >删除</Action.Button>
                    </Action>
                )} />
            </TableCard>
        </div>
    )
}

export default TableList